package cn.school.service;

import org.apache.ibatis.session.SqlSession;

import cn.school.dao.GradeDao;
import cn.school.dao.StudentDao;
import cn.school.entity.Grade;
import cn.school.util.MyBatisUtil;

public class GradeService {
	public Grade get(long id) {
		SqlSession s = MyBatisUtil.get();
		try {
			GradeDao studentDao = s.getMapper(GradeDao.class);
			return studentDao.get(id);
		} finally {
			MyBatisUtil.close(s);
		}
	}

	public java.util.List<Grade> findALL() {

		SqlSession s = MyBatisUtil.get();
		try {
			GradeDao studentDao = s.getMapper(GradeDao.class);
			return studentDao.findALL();
		} finally {
			MyBatisUtil.close(s);
		}

	}
}
